﻿using System;
using System.ComponentModel;
using System.IO;
using System.Runtime.Serialization;

namespace HalconDotNet
{
	/// <summary>Represents an instance of a multilayer perceptron.</summary>
	// Token: 0x02000024 RID: 36
	[Serializable]
	public class HClassMlp : HHandle, ISerializable, ICloneable
	{
		// Token: 0x060002DB RID: 731 RVA: 0x0000883B File Offset: 0x00006A3B
		[EditorBrowsable(EditorBrowsableState.Never)]
		public HClassMlp() : base(HHandleBase.UNDEF)
		{
		}

		// Token: 0x060002DC RID: 732 RVA: 0x0001179E File Offset: 0x0000F99E
		[EditorBrowsable(EditorBrowsableState.Never)]
		public HClassMlp(IntPtr handle) : base(handle)
		{
			this.AssertSemType();
		}

		// Token: 0x060002DD RID: 733 RVA: 0x000117AD File Offset: 0x0000F9AD
		[EditorBrowsable(EditorBrowsableState.Never)]
		public HClassMlp(HHandle handle) : base(handle)
		{
			this.AssertSemType();
		}

		// Token: 0x060002DE RID: 734 RVA: 0x000117BC File Offset: 0x0000F9BC
		private void AssertSemType()
		{
			base.AssertSemType("class_mlp");
		}

		// Token: 0x060002DF RID: 735 RVA: 0x000117C9 File Offset: 0x0000F9C9
		internal static int LoadNew(IntPtr proc, int parIndex, int err, out HClassMlp obj)
		{
			obj = new HClassMlp(HHandleBase.UNDEF);
			return obj.Load(proc, parIndex, err);
		}

		// Token: 0x060002E0 RID: 736 RVA: 0x000117E4 File Offset: 0x0000F9E4
		internal static int LoadNew(IntPtr proc, int parIndex, int err, out HClassMlp[] obj)
		{
			HTuple htuple;
			err = HTuple.LoadNew(proc, parIndex, err, out htuple);
			obj = new HClassMlp[htuple.Length];
			for (int i = 0; i < htuple.Length; i++)
			{
				obj[i] = new HClassMlp(HalconAPI.IsLegacyHandleMode() ? htuple[i].IP : htuple[i].H);
			}
			htuple.Dispose();
			return err;
		}

		/// <summary>
		///   Read a multilayer perceptron from a file.
		///   Modified instance represents: MLP handle.
		/// </summary>
		/// <param name="fileName">File name.</param>
		// Token: 0x060002E1 RID: 737 RVA: 0x00011854 File Offset: 0x0000FA54
		public HClassMlp(string fileName)
		{
			IntPtr proc = HalconAPI.PreCall(1867);
			HalconAPI.StoreS(proc, 0, fileName);
			HalconAPI.InitOCT(proc, 0);
			int num = HalconAPI.CallProcedure(proc);
			num = base.Load(proc, 0, num);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
		}

		/// <summary>
		///   Create a multilayer perceptron for classification or regression.
		///   Modified instance represents: MLP handle.
		/// </summary>
		/// <param name="numInput">Number of input variables (features) of the MLP. Default: 20</param>
		/// <param name="numHidden">Number of hidden units of the MLP. Default: 10</param>
		/// <param name="numOutput">Number of output variables (classes) of the MLP. Default: 5</param>
		/// <param name="outputFunction">Type of the activation function in the output layer of the MLP. Default: "softmax"</param>
		/// <param name="preprocessing">Type of preprocessing used to transform the feature vectors. Default: "normalization"</param>
		/// <param name="numComponents">Preprocessing parameter: Number of transformed features (ignored for Preprocessing $=$ 'none' and Preprocessing $=$ 'normalization'). Default: 10</param>
		/// <param name="randSeed">Seed value of the random number generator that is used to initialize the MLP with random values. Default: 42</param>
		// Token: 0x060002E2 RID: 738 RVA: 0x000118A0 File Offset: 0x0000FAA0
		public HClassMlp(int numInput, int numHidden, int numOutput, string outputFunction, string preprocessing, int numComponents, int randSeed)
		{
			IntPtr proc = HalconAPI.PreCall(1883);
			HalconAPI.StoreI(proc, 0, numInput);
			HalconAPI.StoreI(proc, 1, numHidden);
			HalconAPI.StoreI(proc, 2, numOutput);
			HalconAPI.StoreS(proc, 3, outputFunction);
			HalconAPI.StoreS(proc, 4, preprocessing);
			HalconAPI.StoreI(proc, 5, numComponents);
			HalconAPI.StoreI(proc, 6, randSeed);
			HalconAPI.InitOCT(proc, 0);
			int num = HalconAPI.CallProcedure(proc);
			num = base.Load(proc, 0, num);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
		}

		// Token: 0x060002E3 RID: 739 RVA: 0x00011920 File Offset: 0x0000FB20
		void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
		{
			HSerializedItem hserializedItem = this.SerializeClassMlp();
			byte[] value = hserializedItem;
			hserializedItem.Dispose();
			info.AddValue("data", value, typeof(byte[]));
		}

		// Token: 0x060002E4 RID: 740 RVA: 0x00011958 File Offset: 0x0000FB58
		[EditorBrowsable(EditorBrowsableState.Never)]
		public HClassMlp(SerializationInfo info, StreamingContext context)
		{
			HSerializedItem hserializedItem = new HSerializedItem((byte[])info.GetValue("data", typeof(byte[])));
			this.DeserializeClassMlp(hserializedItem);
			hserializedItem.Dispose();
		}

		/// <summary>Serialize object to binary stream in HALCON format</summary>
		// Token: 0x060002E5 RID: 741 RVA: 0x00011998 File Offset: 0x0000FB98
		public new void Serialize(Stream stream)
		{
			HSerializedItem hserializedItem = this.SerializeClassMlp();
			hserializedItem.Serialize(stream);
			hserializedItem.Dispose();
		}

		/// <summary>Deserialize object from binary stream in HALCON format</summary>
		// Token: 0x060002E6 RID: 742 RVA: 0x000119AC File Offset: 0x0000FBAC
		public new static HClassMlp Deserialize(Stream stream)
		{
			HClassMlp hclassMlp = new HClassMlp();
			HSerializedItem hserializedItem = HSerializedItem.Deserialize(stream);
			hclassMlp.DeserializeClassMlp(hserializedItem);
			hserializedItem.Dispose();
			return hclassMlp;
		}

		// Token: 0x060002E7 RID: 743 RVA: 0x000119D2 File Offset: 0x0000FBD2
		object ICloneable.Clone()
		{
			return this.Clone();
		}

		// Token: 0x060002E8 RID: 744 RVA: 0x000119DC File Offset: 0x0000FBDC
		public new HClassMlp Clone()
		{
			HSerializedItem hserializedItem = this.SerializeClassMlp();
			HClassMlp hclassMlp = new HClassMlp();
			hclassMlp.DeserializeClassMlp(hserializedItem);
			hserializedItem.Dispose();
			return hclassMlp;
		}

		/// <summary>
		///   Classify an image with a multilayer perceptron.
		///   Instance represents: MLP handle.
		/// </summary>
		/// <param name="image">Input image.</param>
		/// <param name="rejectionThreshold">Threshold for the rejection of the classification. Default: 0.5</param>
		/// <returns>Segmented classes.</returns>
		// Token: 0x060002E9 RID: 745 RVA: 0x00011A04 File Offset: 0x0000FC04
		public HRegion ClassifyImageClassMlp(HImage image, double rejectionThreshold)
		{
			IntPtr proc = HalconAPI.PreCall(435);
			base.Store(proc, 0);
			HalconAPI.Store(proc, 1, image);
			HalconAPI.StoreD(proc, 1, rejectionThreshold);
			HalconAPI.InitOCT(proc, 1);
			int num = HalconAPI.CallProcedure(proc);
			HRegion result;
			num = HRegion.LoadNew(proc, 1, num, out result);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			GC.KeepAlive(image);
			return result;
		}

		/// <summary>
		///   Add training samples from an image to the training data of a multilayer perceptron.
		///   Instance represents: MLP handle.
		/// </summary>
		/// <param name="image">Training image.</param>
		/// <param name="classRegions">Regions of the classes to be trained.</param>
		// Token: 0x060002EA RID: 746 RVA: 0x00011A64 File Offset: 0x0000FC64
		public void AddSamplesImageClassMlp(HImage image, HRegion classRegions)
		{
			IntPtr proc = HalconAPI.PreCall(436);
			base.Store(proc, 0);
			HalconAPI.Store(proc, 1, image);
			HalconAPI.Store(proc, 2, classRegions);
			int procResult = HalconAPI.CallProcedure(proc);
			HalconAPI.PostCall(proc, procResult);
			GC.KeepAlive(this);
			GC.KeepAlive(image);
			GC.KeepAlive(classRegions);
		}

		/// <summary>
		///   Get the training data of a multilayer perceptron (MLP).
		///   Instance represents: Handle of a MLP that contains training data.
		/// </summary>
		/// <returns>Handle of the training data of the classifier.</returns>
		// Token: 0x060002EB RID: 747 RVA: 0x00011AB4 File Offset: 0x0000FCB4
		public HClassTrainData GetClassTrainDataMlp()
		{
			IntPtr proc = HalconAPI.PreCall(1787);
			base.Store(proc, 0);
			HalconAPI.InitOCT(proc, 0);
			int num = HalconAPI.CallProcedure(proc);
			HClassTrainData result;
			num = HClassTrainData.LoadNew(proc, 0, num, out result);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			return result;
		}

		/// <summary>
		///   Add training data to a multilayer perceptron (MLP).
		///   Instance represents: MLP handle which receives the training data.
		/// </summary>
		/// <param name="classTrainDataHandle">Training data for a classifier.</param>
		// Token: 0x060002EC RID: 748 RVA: 0x00011AFC File Offset: 0x0000FCFC
		public void AddClassTrainDataMlp(HClassTrainData classTrainDataHandle)
		{
			IntPtr proc = HalconAPI.PreCall(1788);
			base.Store(proc, 0);
			HalconAPI.Store(proc, 1, classTrainDataHandle);
			int procResult = HalconAPI.CallProcedure(proc);
			HalconAPI.PostCall(proc, procResult);
			GC.KeepAlive(this);
			GC.KeepAlive(classTrainDataHandle);
		}

		/// <summary>
		///   Selects an optimal combination of features to classify the provided data.
		///   Modified instance represents: A trained MLP classifier using only the selected  features.
		/// </summary>
		/// <param name="classTrainDataHandle">Handle of the training data.</param>
		/// <param name="selectionMethod">Method to perform the selection. Default: "greedy"</param>
		/// <param name="genParamName">Names of generic parameters to configure the  selection process and the classifier. Default: []</param>
		/// <param name="genParamValue">Values of generic parameters to configure the  selection process and the classifier. Default: []</param>
		/// <param name="score">The achieved score using two-fold cross-validation.</param>
		/// <returns>The selected feature set, contains  indices referring.</returns>
		// Token: 0x060002ED RID: 749 RVA: 0x00011B40 File Offset: 0x0000FD40
		public HTuple SelectFeatureSetMlp(HClassTrainData classTrainDataHandle, string selectionMethod, HTuple genParamName, HTuple genParamValue, out HTuple score)
		{
			this.Dispose();
			IntPtr proc = HalconAPI.PreCall(1799);
			HalconAPI.Store(proc, 0, classTrainDataHandle);
			HalconAPI.StoreS(proc, 1, selectionMethod);
			HalconAPI.Store(proc, 2, genParamName);
			HalconAPI.Store(proc, 3, genParamValue);
			HalconAPI.InitOCT(proc, 0);
			HalconAPI.InitOCT(proc, 1);
			HalconAPI.InitOCT(proc, 2);
			int num = HalconAPI.CallProcedure(proc);
			HalconAPI.UnpinTuple(genParamName);
			HalconAPI.UnpinTuple(genParamValue);
			num = base.Load(proc, 0, num);
			HTuple result;
			num = HTuple.LoadNew(proc, 1, num, out result);
			num = HTuple.LoadNew(proc, 2, HTupleType.DOUBLE, num, out score);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			GC.KeepAlive(classTrainDataHandle);
			return result;
		}

		/// <summary>
		///   Selects an optimal combination of features to classify the provided data.
		///   Modified instance represents: A trained MLP classifier using only the selected  features.
		/// </summary>
		/// <param name="classTrainDataHandle">Handle of the training data.</param>
		/// <param name="selectionMethod">Method to perform the selection. Default: "greedy"</param>
		/// <param name="genParamName">Names of generic parameters to configure the  selection process and the classifier. Default: []</param>
		/// <param name="genParamValue">Values of generic parameters to configure the  selection process and the classifier. Default: []</param>
		/// <param name="score">The achieved score using two-fold cross-validation.</param>
		/// <returns>The selected feature set, contains  indices referring.</returns>
		// Token: 0x060002EE RID: 750 RVA: 0x00011BE0 File Offset: 0x0000FDE0
		public HTuple SelectFeatureSetMlp(HClassTrainData classTrainDataHandle, string selectionMethod, string genParamName, double genParamValue, out HTuple score)
		{
			this.Dispose();
			IntPtr proc = HalconAPI.PreCall(1799);
			HalconAPI.Store(proc, 0, classTrainDataHandle);
			HalconAPI.StoreS(proc, 1, selectionMethod);
			HalconAPI.StoreS(proc, 2, genParamName);
			HalconAPI.StoreD(proc, 3, genParamValue);
			HalconAPI.InitOCT(proc, 0);
			HalconAPI.InitOCT(proc, 1);
			HalconAPI.InitOCT(proc, 2);
			int num = HalconAPI.CallProcedure(proc);
			num = base.Load(proc, 0, num);
			HTuple result;
			num = HTuple.LoadNew(proc, 1, num, out result);
			num = HTuple.LoadNew(proc, 2, HTupleType.DOUBLE, num, out score);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			GC.KeepAlive(classTrainDataHandle);
			return result;
		}

		/// <summary>
		///   Create a look-up table using a multi-layer perceptron to classify byte images.
		///   Instance represents: MLP handle.
		/// </summary>
		/// <param name="genParamName">Names of the generic parameters that can be adjusted for the LUT classifier creation. Default: []</param>
		/// <param name="genParamValue">Values of the generic parameters that can be adjusted for the LUT classifier creation. Default: []</param>
		/// <returns>Handle of the LUT classifier.</returns>
		// Token: 0x060002EF RID: 751 RVA: 0x00011C74 File Offset: 0x0000FE74
		public HClassLUT CreateClassLutMlp(HTuple genParamName, HTuple genParamValue)
		{
			IntPtr proc = HalconAPI.PreCall(1822);
			base.Store(proc, 0);
			HalconAPI.Store(proc, 1, genParamName);
			HalconAPI.Store(proc, 2, genParamValue);
			HalconAPI.InitOCT(proc, 0);
			int num = HalconAPI.CallProcedure(proc);
			HalconAPI.UnpinTuple(genParamName);
			HalconAPI.UnpinTuple(genParamValue);
			HClassLUT result;
			num = HClassLUT.LoadNew(proc, 0, num, out result);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			return result;
		}

		/// <summary>Clear a multilayer perceptron.</summary>
		/// <param name="MLPHandle">MLP handle.</param>
		// Token: 0x060002F0 RID: 752 RVA: 0x00011CD8 File Offset: 0x0000FED8
		public static void ClearClassMlp(HClassMlp[] MLPHandle)
		{
			HTuple htuple = HHandleBase.ConcatArray(MLPHandle);
			IntPtr proc = HalconAPI.PreCall(1863);
			HalconAPI.Store(proc, 0, htuple);
			int procResult = HalconAPI.CallProcedure(proc);
			HalconAPI.UnpinTuple(htuple);
			HalconAPI.PostCall(proc, procResult);
			GC.KeepAlive(MLPHandle);
		}

		/// <summary>
		///   Clear a multilayer perceptron.
		///   Instance represents: MLP handle.
		/// </summary>
		// Token: 0x060002F1 RID: 753 RVA: 0x00011D1C File Offset: 0x0000FF1C
		public void ClearClassMlp()
		{
			IntPtr proc = HalconAPI.PreCall(1863);
			base.Store(proc, 0);
			int procResult = HalconAPI.CallProcedure(proc);
			HalconAPI.PostCall(proc, procResult);
			GC.KeepAlive(this);
		}

		/// <summary>Clear the training data of a multilayer perceptron.</summary>
		/// <param name="MLPHandle">MLP handle.</param>
		// Token: 0x060002F2 RID: 754 RVA: 0x00011D50 File Offset: 0x0000FF50
		public static void ClearSamplesClassMlp(HClassMlp[] MLPHandle)
		{
			HTuple htuple = HHandleBase.ConcatArray(MLPHandle);
			IntPtr proc = HalconAPI.PreCall(1864);
			HalconAPI.Store(proc, 0, htuple);
			int procResult = HalconAPI.CallProcedure(proc);
			HalconAPI.UnpinTuple(htuple);
			HalconAPI.PostCall(proc, procResult);
			GC.KeepAlive(MLPHandle);
		}

		/// <summary>
		///   Clear the training data of a multilayer perceptron.
		///   Instance represents: MLP handle.
		/// </summary>
		// Token: 0x060002F3 RID: 755 RVA: 0x00011D94 File Offset: 0x0000FF94
		public void ClearSamplesClassMlp()
		{
			IntPtr proc = HalconAPI.PreCall(1864);
			base.Store(proc, 0);
			int procResult = HalconAPI.CallProcedure(proc);
			HalconAPI.PostCall(proc, procResult);
			GC.KeepAlive(this);
		}

		/// <summary>
		///   Deserialize a serialized multilayer perceptron.
		///   Modified instance represents: MLP handle.
		/// </summary>
		/// <param name="serializedItemHandle">Handle of the serialized item.</param>
		// Token: 0x060002F4 RID: 756 RVA: 0x00011DC8 File Offset: 0x0000FFC8
		public void DeserializeClassMlp(HSerializedItem serializedItemHandle)
		{
			this.Dispose();
			IntPtr proc = HalconAPI.PreCall(1865);
			HalconAPI.Store(proc, 0, serializedItemHandle);
			HalconAPI.InitOCT(proc, 0);
			int num = HalconAPI.CallProcedure(proc);
			num = base.Load(proc, 0, num);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			GC.KeepAlive(serializedItemHandle);
		}

		/// <summary>
		///   Serialize a multilayer perceptron (MLP).
		///   Instance represents: MLP handle.
		/// </summary>
		/// <returns>Handle of the serialized item.</returns>
		// Token: 0x060002F5 RID: 757 RVA: 0x00011E1C File Offset: 0x0001001C
		public HSerializedItem SerializeClassMlp()
		{
			IntPtr proc = HalconAPI.PreCall(1866);
			base.Store(proc, 0);
			HalconAPI.InitOCT(proc, 0);
			int num = HalconAPI.CallProcedure(proc);
			HSerializedItem result;
			num = HSerializedItem.LoadNew(proc, 0, num, out result);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			return result;
		}

		/// <summary>
		///   Read a multilayer perceptron from a file.
		///   Modified instance represents: MLP handle.
		/// </summary>
		/// <param name="fileName">File name.</param>
		// Token: 0x060002F6 RID: 758 RVA: 0x00011E64 File Offset: 0x00010064
		public void ReadClassMlp(string fileName)
		{
			this.Dispose();
			IntPtr proc = HalconAPI.PreCall(1867);
			HalconAPI.StoreS(proc, 0, fileName);
			HalconAPI.InitOCT(proc, 0);
			int num = HalconAPI.CallProcedure(proc);
			num = base.Load(proc, 0, num);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
		}

		/// <summary>
		///   Write a multilayer perceptron to a file.
		///   Instance represents: MLP handle.
		/// </summary>
		/// <param name="fileName">File name.</param>
		// Token: 0x060002F7 RID: 759 RVA: 0x00011EB0 File Offset: 0x000100B0
		public void WriteClassMlp(string fileName)
		{
			IntPtr proc = HalconAPI.PreCall(1868);
			base.Store(proc, 0);
			HalconAPI.StoreS(proc, 1, fileName);
			int procResult = HalconAPI.CallProcedure(proc);
			HalconAPI.PostCall(proc, procResult);
			GC.KeepAlive(this);
		}

		/// <summary>
		///   Read the training data of a multilayer perceptron from a file.
		///   Instance represents: MLP handle.
		/// </summary>
		/// <param name="fileName">File name.</param>
		// Token: 0x060002F8 RID: 760 RVA: 0x00011EEC File Offset: 0x000100EC
		public void ReadSamplesClassMlp(string fileName)
		{
			IntPtr proc = HalconAPI.PreCall(1869);
			base.Store(proc, 0);
			HalconAPI.StoreS(proc, 1, fileName);
			int procResult = HalconAPI.CallProcedure(proc);
			HalconAPI.PostCall(proc, procResult);
			GC.KeepAlive(this);
		}

		/// <summary>
		///   Write the training data of a multilayer perceptron to a file.
		///   Instance represents: MLP handle.
		/// </summary>
		/// <param name="fileName">File name.</param>
		// Token: 0x060002F9 RID: 761 RVA: 0x00011F28 File Offset: 0x00010128
		public void WriteSamplesClassMlp(string fileName)
		{
			IntPtr proc = HalconAPI.PreCall(1870);
			base.Store(proc, 0);
			HalconAPI.StoreS(proc, 1, fileName);
			int procResult = HalconAPI.CallProcedure(proc);
			HalconAPI.PostCall(proc, procResult);
			GC.KeepAlive(this);
		}

		/// <summary>
		///   Calculate the class of a feature vector by a multilayer perceptron.
		///   Instance represents: MLP handle.
		/// </summary>
		/// <param name="features">Feature vector.</param>
		/// <param name="num">Number of best classes to determine. Default: 1</param>
		/// <param name="confidence">Confidence(s) of the class(es) of the feature vector.</param>
		/// <returns>Result of classifying the feature vector with the MLP.</returns>
		// Token: 0x060002FA RID: 762 RVA: 0x00011F64 File Offset: 0x00010164
		public HTuple ClassifyClassMlp(HTuple features, HTuple num, out HTuple confidence)
		{
			IntPtr proc = HalconAPI.PreCall(1871);
			base.Store(proc, 0);
			HalconAPI.Store(proc, 1, features);
			HalconAPI.Store(proc, 2, num);
			HalconAPI.InitOCT(proc, 0);
			HalconAPI.InitOCT(proc, 1);
			int num2 = HalconAPI.CallProcedure(proc);
			HalconAPI.UnpinTuple(features);
			HalconAPI.UnpinTuple(num);
			HTuple result;
			num2 = HTuple.LoadNew(proc, 0, HTupleType.INTEGER, num2, out result);
			num2 = HTuple.LoadNew(proc, 1, HTupleType.DOUBLE, num2, out confidence);
			HalconAPI.PostCall(proc, num2);
			GC.KeepAlive(this);
			return result;
		}

		/// <summary>
		///   Calculate the class of a feature vector by a multilayer perceptron.
		///   Instance represents: MLP handle.
		/// </summary>
		/// <param name="features">Feature vector.</param>
		/// <param name="num">Number of best classes to determine. Default: 1</param>
		/// <param name="confidence">Confidence(s) of the class(es) of the feature vector.</param>
		/// <returns>Result of classifying the feature vector with the MLP.</returns>
		// Token: 0x060002FB RID: 763 RVA: 0x00011FDC File Offset: 0x000101DC
		public int ClassifyClassMlp(HTuple features, HTuple num, out double confidence)
		{
			IntPtr proc = HalconAPI.PreCall(1871);
			base.Store(proc, 0);
			HalconAPI.Store(proc, 1, features);
			HalconAPI.Store(proc, 2, num);
			HalconAPI.InitOCT(proc, 0);
			HalconAPI.InitOCT(proc, 1);
			int num2 = HalconAPI.CallProcedure(proc);
			HalconAPI.UnpinTuple(features);
			HalconAPI.UnpinTuple(num);
			int result;
			num2 = HalconAPI.LoadI(proc, 0, num2, out result);
			num2 = HalconAPI.LoadD(proc, 1, num2, out confidence);
			HalconAPI.PostCall(proc, num2);
			GC.KeepAlive(this);
			return result;
		}

		/// <summary>
		///   Calculate the evaluation of a feature vector by a multilayer perceptron.
		///   Instance represents: MLP handle.
		/// </summary>
		/// <param name="features">Feature vector.</param>
		/// <returns>Result of evaluating the feature vector with the MLP.</returns>
		// Token: 0x060002FC RID: 764 RVA: 0x00012054 File Offset: 0x00010254
		public HTuple EvaluateClassMlp(HTuple features)
		{
			IntPtr proc = HalconAPI.PreCall(1872);
			base.Store(proc, 0);
			HalconAPI.Store(proc, 1, features);
			HalconAPI.InitOCT(proc, 0);
			int num = HalconAPI.CallProcedure(proc);
			HalconAPI.UnpinTuple(features);
			HTuple result;
			num = HTuple.LoadNew(proc, 0, HTupleType.DOUBLE, num, out result);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			return result;
		}

		/// <summary>
		///   Train a multilayer perceptron.
		///   Instance represents: MLP handle.
		/// </summary>
		/// <param name="maxIterations">Maximum number of iterations of the optimization algorithm. Default: 200</param>
		/// <param name="weightTolerance">Threshold for the difference of the weights of the MLP between two iterations of the optimization algorithm. Default: 1.0</param>
		/// <param name="errorTolerance">Threshold for the difference of the mean error of the MLP on the training data between two iterations of the optimization algorithm. Default: 0.01</param>
		/// <param name="errorLog">Mean error of the MLP on the training data as a function of the number of iterations of the optimization algorithm.</param>
		/// <returns>Mean error of the MLP on the training data.</returns>
		// Token: 0x060002FD RID: 765 RVA: 0x000120AC File Offset: 0x000102AC
		public double TrainClassMlp(int maxIterations, double weightTolerance, double errorTolerance, out HTuple errorLog)
		{
			IntPtr proc = HalconAPI.PreCall(1873);
			base.Store(proc, 0);
			HalconAPI.StoreI(proc, 1, maxIterations);
			HalconAPI.StoreD(proc, 2, weightTolerance);
			HalconAPI.StoreD(proc, 3, errorTolerance);
			HalconAPI.InitOCT(proc, 0);
			HalconAPI.InitOCT(proc, 1);
			int num = HalconAPI.CallProcedure(proc);
			double result;
			num = HalconAPI.LoadD(proc, 0, num, out result);
			num = HTuple.LoadNew(proc, 1, HTupleType.DOUBLE, num, out errorLog);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			return result;
		}

		/// <summary>
		///   Compute the information content of the preprocessed feature vectors of a multilayer perceptron.
		///   Instance represents: MLP handle.
		/// </summary>
		/// <param name="preprocessing">Type of preprocessing used to transform the feature vectors. Default: "principal_components"</param>
		/// <param name="cumInformationCont">Cumulative information content of the transformed feature vectors.</param>
		/// <returns>Relative information content of the transformed feature vectors.</returns>
		// Token: 0x060002FE RID: 766 RVA: 0x00012120 File Offset: 0x00010320
		public HTuple GetPrepInfoClassMlp(string preprocessing, out HTuple cumInformationCont)
		{
			IntPtr proc = HalconAPI.PreCall(1874);
			base.Store(proc, 0);
			HalconAPI.StoreS(proc, 1, preprocessing);
			HalconAPI.InitOCT(proc, 0);
			HalconAPI.InitOCT(proc, 1);
			int num = HalconAPI.CallProcedure(proc);
			HTuple result;
			num = HTuple.LoadNew(proc, 0, HTupleType.DOUBLE, num, out result);
			num = HTuple.LoadNew(proc, 1, HTupleType.DOUBLE, num, out cumInformationCont);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			return result;
		}

		/// <summary>
		///   Return the number of training samples stored in the training data of a multilayer perceptron.
		///   Instance represents: MLP handle.
		/// </summary>
		/// <returns>Number of stored training samples.</returns>
		// Token: 0x060002FF RID: 767 RVA: 0x00012184 File Offset: 0x00010384
		public int GetSampleNumClassMlp()
		{
			IntPtr proc = HalconAPI.PreCall(1875);
			base.Store(proc, 0);
			HalconAPI.InitOCT(proc, 0);
			int num = HalconAPI.CallProcedure(proc);
			int result;
			num = HalconAPI.LoadI(proc, 0, num, out result);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			return result;
		}

		/// <summary>
		///   Return a training sample from the training data of a multilayer perceptron.
		///   Instance represents: MLP handle.
		/// </summary>
		/// <param name="indexSample">Number of stored training sample.</param>
		/// <param name="target">Target vector of the training sample.</param>
		/// <returns>Feature vector of the training sample.</returns>
		// Token: 0x06000300 RID: 768 RVA: 0x000121CC File Offset: 0x000103CC
		public HTuple GetSampleClassMlp(int indexSample, out HTuple target)
		{
			IntPtr proc = HalconAPI.PreCall(1876);
			base.Store(proc, 0);
			HalconAPI.StoreI(proc, 1, indexSample);
			HalconAPI.InitOCT(proc, 0);
			HalconAPI.InitOCT(proc, 1);
			int num = HalconAPI.CallProcedure(proc);
			HTuple result;
			num = HTuple.LoadNew(proc, 0, HTupleType.DOUBLE, num, out result);
			num = HTuple.LoadNew(proc, 1, HTupleType.DOUBLE, num, out target);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			return result;
		}

		/// <summary>
		///   Get the parameters of a rejection class.
		///   Instance represents: MLP handle.
		/// </summary>
		/// <param name="genParamName">Names of the generic parameters to return. Default: "sampling_strategy"</param>
		/// <returns>Values of the generic parameters.</returns>
		// Token: 0x06000301 RID: 769 RVA: 0x00012230 File Offset: 0x00010430
		public HTuple GetRejectionParamsClassMlp(HTuple genParamName)
		{
			IntPtr proc = HalconAPI.PreCall(1877);
			base.Store(proc, 0);
			HalconAPI.Store(proc, 1, genParamName);
			HalconAPI.InitOCT(proc, 0);
			int num = HalconAPI.CallProcedure(proc);
			HalconAPI.UnpinTuple(genParamName);
			HTuple result;
			num = HTuple.LoadNew(proc, 0, num, out result);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			return result;
		}

		/// <summary>
		///   Get the parameters of a rejection class.
		///   Instance represents: MLP handle.
		/// </summary>
		/// <param name="genParamName">Names of the generic parameters to return. Default: "sampling_strategy"</param>
		/// <returns>Values of the generic parameters.</returns>
		// Token: 0x06000302 RID: 770 RVA: 0x00012288 File Offset: 0x00010488
		public HTuple GetRejectionParamsClassMlp(string genParamName)
		{
			IntPtr proc = HalconAPI.PreCall(1877);
			base.Store(proc, 0);
			HalconAPI.StoreS(proc, 1, genParamName);
			HalconAPI.InitOCT(proc, 0);
			int num = HalconAPI.CallProcedure(proc);
			HTuple result;
			num = HTuple.LoadNew(proc, 0, num, out result);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			return result;
		}

		/// <summary>
		///   Set the parameters of a rejection class.
		///   Instance represents: MLP handle.
		/// </summary>
		/// <param name="genParamName">Names of the generic parameters. Default: "sampling_strategy"</param>
		/// <param name="genParamValue">Values of the generic parameters. Default: "hyperbox_around_all_classes"</param>
		// Token: 0x06000303 RID: 771 RVA: 0x000122D8 File Offset: 0x000104D8
		public void SetRejectionParamsClassMlp(HTuple genParamName, HTuple genParamValue)
		{
			IntPtr proc = HalconAPI.PreCall(1878);
			base.Store(proc, 0);
			HalconAPI.Store(proc, 1, genParamName);
			HalconAPI.Store(proc, 2, genParamValue);
			int procResult = HalconAPI.CallProcedure(proc);
			HalconAPI.UnpinTuple(genParamName);
			HalconAPI.UnpinTuple(genParamValue);
			HalconAPI.PostCall(proc, procResult);
			GC.KeepAlive(this);
		}

		/// <summary>
		///   Set the parameters of a rejection class.
		///   Instance represents: MLP handle.
		/// </summary>
		/// <param name="genParamName">Names of the generic parameters. Default: "sampling_strategy"</param>
		/// <param name="genParamValue">Values of the generic parameters. Default: "hyperbox_around_all_classes"</param>
		// Token: 0x06000304 RID: 772 RVA: 0x00012328 File Offset: 0x00010528
		public void SetRejectionParamsClassMlp(string genParamName, string genParamValue)
		{
			IntPtr proc = HalconAPI.PreCall(1878);
			base.Store(proc, 0);
			HalconAPI.StoreS(proc, 1, genParamName);
			HalconAPI.StoreS(proc, 2, genParamValue);
			int procResult = HalconAPI.CallProcedure(proc);
			HalconAPI.PostCall(proc, procResult);
			GC.KeepAlive(this);
		}

		/// <summary>
		///   Add a training sample to the training data of a multilayer perceptron.
		///   Instance represents: MLP handle.
		/// </summary>
		/// <param name="features">Feature vector of the training sample to be stored.</param>
		/// <param name="target">Class or target vector of the training sample to be stored.</param>
		// Token: 0x06000305 RID: 773 RVA: 0x0001236C File Offset: 0x0001056C
		public void AddSampleClassMlp(HTuple features, HTuple target)
		{
			IntPtr proc = HalconAPI.PreCall(1879);
			base.Store(proc, 0);
			HalconAPI.Store(proc, 1, features);
			HalconAPI.Store(proc, 2, target);
			int procResult = HalconAPI.CallProcedure(proc);
			HalconAPI.UnpinTuple(features);
			HalconAPI.UnpinTuple(target);
			HalconAPI.PostCall(proc, procResult);
			GC.KeepAlive(this);
		}

		/// <summary>
		///   Add a training sample to the training data of a multilayer perceptron.
		///   Instance represents: MLP handle.
		/// </summary>
		/// <param name="features">Feature vector of the training sample to be stored.</param>
		/// <param name="target">Class or target vector of the training sample to be stored.</param>
		// Token: 0x06000306 RID: 774 RVA: 0x000123BC File Offset: 0x000105BC
		public void AddSampleClassMlp(HTuple features, int target)
		{
			IntPtr proc = HalconAPI.PreCall(1879);
			base.Store(proc, 0);
			HalconAPI.Store(proc, 1, features);
			HalconAPI.StoreI(proc, 2, target);
			int procResult = HalconAPI.CallProcedure(proc);
			HalconAPI.UnpinTuple(features);
			HalconAPI.PostCall(proc, procResult);
			GC.KeepAlive(this);
		}

		/// <summary>
		///   Return the regularization parameters of a multilayer perceptron.
		///   Instance represents: MLP handle.
		/// </summary>
		/// <param name="genParamName">Name of the regularization parameter to return. Default: "weight_prior"</param>
		/// <returns>Value of the regularization parameter.</returns>
		// Token: 0x06000307 RID: 775 RVA: 0x00012408 File Offset: 0x00010608
		public HTuple GetRegularizationParamsClassMlp(string genParamName)
		{
			IntPtr proc = HalconAPI.PreCall(1880);
			base.Store(proc, 0);
			HalconAPI.StoreS(proc, 1, genParamName);
			HalconAPI.InitOCT(proc, 0);
			int num = HalconAPI.CallProcedure(proc);
			HTuple result;
			num = HTuple.LoadNew(proc, 0, num, out result);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			return result;
		}

		/// <summary>
		///   Set the regularization parameters of a multilayer perceptron.
		///   Instance represents: MLP handle.
		/// </summary>
		/// <param name="genParamName">Name of the regularization parameter to set. Default: "weight_prior"</param>
		/// <param name="genParamValue">Value of the regularization parameter. Default: 1.0</param>
		// Token: 0x06000308 RID: 776 RVA: 0x00012458 File Offset: 0x00010658
		public void SetRegularizationParamsClassMlp(string genParamName, HTuple genParamValue)
		{
			IntPtr proc = HalconAPI.PreCall(1881);
			base.Store(proc, 0);
			HalconAPI.StoreS(proc, 1, genParamName);
			HalconAPI.Store(proc, 2, genParamValue);
			int procResult = HalconAPI.CallProcedure(proc);
			HalconAPI.UnpinTuple(genParamValue);
			HalconAPI.PostCall(proc, procResult);
			GC.KeepAlive(this);
		}

		/// <summary>
		///   Set the regularization parameters of a multilayer perceptron.
		///   Instance represents: MLP handle.
		/// </summary>
		/// <param name="genParamName">Name of the regularization parameter to set. Default: "weight_prior"</param>
		/// <param name="genParamValue">Value of the regularization parameter. Default: 1.0</param>
		// Token: 0x06000309 RID: 777 RVA: 0x000124A4 File Offset: 0x000106A4
		public void SetRegularizationParamsClassMlp(string genParamName, double genParamValue)
		{
			IntPtr proc = HalconAPI.PreCall(1881);
			base.Store(proc, 0);
			HalconAPI.StoreS(proc, 1, genParamName);
			HalconAPI.StoreD(proc, 2, genParamValue);
			int procResult = HalconAPI.CallProcedure(proc);
			HalconAPI.PostCall(proc, procResult);
			GC.KeepAlive(this);
		}

		/// <summary>
		///   Return the parameters of a multilayer perceptron.
		///   Instance represents: MLP handle.
		/// </summary>
		/// <param name="numHidden">Number of hidden units of the MLP.</param>
		/// <param name="numOutput">Number of output variables (classes) of the MLP.</param>
		/// <param name="outputFunction">Type of the activation function in the output layer of the MLP.</param>
		/// <param name="preprocessing">Type of preprocessing used to transform the feature vectors.</param>
		/// <param name="numComponents">Preprocessing parameter: Number of transformed features.</param>
		/// <returns>Number of input variables (features) of the MLP.</returns>
		// Token: 0x0600030A RID: 778 RVA: 0x000124E8 File Offset: 0x000106E8
		public int GetParamsClassMlp(out int numHidden, out int numOutput, out string outputFunction, out string preprocessing, out int numComponents)
		{
			IntPtr proc = HalconAPI.PreCall(1882);
			base.Store(proc, 0);
			HalconAPI.InitOCT(proc, 0);
			HalconAPI.InitOCT(proc, 1);
			HalconAPI.InitOCT(proc, 2);
			HalconAPI.InitOCT(proc, 3);
			HalconAPI.InitOCT(proc, 4);
			HalconAPI.InitOCT(proc, 5);
			int num = HalconAPI.CallProcedure(proc);
			int result;
			num = HalconAPI.LoadI(proc, 0, num, out result);
			num = HalconAPI.LoadI(proc, 1, num, out numHidden);
			num = HalconAPI.LoadI(proc, 2, num, out numOutput);
			num = HalconAPI.LoadS(proc, 3, num, out outputFunction);
			num = HalconAPI.LoadS(proc, 4, num, out preprocessing);
			num = HalconAPI.LoadI(proc, 5, num, out numComponents);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			return result;
		}

		/// <summary>
		///   Create a multilayer perceptron for classification or regression.
		///   Modified instance represents: MLP handle.
		/// </summary>
		/// <param name="numInput">Number of input variables (features) of the MLP. Default: 20</param>
		/// <param name="numHidden">Number of hidden units of the MLP. Default: 10</param>
		/// <param name="numOutput">Number of output variables (classes) of the MLP. Default: 5</param>
		/// <param name="outputFunction">Type of the activation function in the output layer of the MLP. Default: "softmax"</param>
		/// <param name="preprocessing">Type of preprocessing used to transform the feature vectors. Default: "normalization"</param>
		/// <param name="numComponents">Preprocessing parameter: Number of transformed features (ignored for Preprocessing $=$ 'none' and Preprocessing $=$ 'normalization'). Default: 10</param>
		/// <param name="randSeed">Seed value of the random number generator that is used to initialize the MLP with random values. Default: 42</param>
		// Token: 0x0600030B RID: 779 RVA: 0x0001258C File Offset: 0x0001078C
		public void CreateClassMlp(int numInput, int numHidden, int numOutput, string outputFunction, string preprocessing, int numComponents, int randSeed)
		{
			this.Dispose();
			IntPtr proc = HalconAPI.PreCall(1883);
			HalconAPI.StoreI(proc, 0, numInput);
			HalconAPI.StoreI(proc, 1, numHidden);
			HalconAPI.StoreI(proc, 2, numOutput);
			HalconAPI.StoreS(proc, 3, outputFunction);
			HalconAPI.StoreS(proc, 4, preprocessing);
			HalconAPI.StoreI(proc, 5, numComponents);
			HalconAPI.StoreI(proc, 6, randSeed);
			HalconAPI.InitOCT(proc, 0);
			int num = HalconAPI.CallProcedure(proc);
			num = base.Load(proc, 0, num);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
		}
	}
}
